//
//  AppDelegate.m
//  HZZ_Sb
//
//  Created by tgjr-Hzz on 2018/1/23.
//  Copyright © 2018年 Hzz. All rights reserved.
//

#import "AppDelegate.h"
#import "AppDelegate+Extend.h"
#import "ZMMainViewController.h"
#import "WKNavigationController.h"

#import "HZZPersonalCenterViewController.h"

@interface AppDelegate ()

@property (nonatomic , strong) WKNavigationController *navVC;

@property (nonatomic, strong) ZMMainViewController *mainViewController;

@property (nonatomic, strong) HZZPersonalCenterViewController *leftViewController;


@end

@implementation AppDelegate


- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    
    [self customizeInterface];
    
    [self.window makeKeyAndVisible];
    
    
    
    return YES;
}

-(UIWindow *)window
{
    if (!_window) {
        _window = [[UIWindow alloc]initWithFrame:[UIScreen mainScreen].bounds];
        _window.backgroundColor = [UIColor whiteColor];
        _window.rootViewController = self.navVC;
    }
    return _window;
}

-(WKNavigationController *)navVC
{
    if (!_navVC) {
        _navVC = [[WKNavigationController alloc] initWithRootViewController:self.drawerController];
    }
    return _navVC;
}

-(MMDrawerController *)drawerController
{
    if (!_drawerController) {
        
        _drawerController = [[MMDrawerController alloc]
         initWithCenterViewController:self.mainViewController
         leftDrawerViewController:self.leftViewController
         rightDrawerViewController:nil];
        
        //这玩意默认黑的
        _drawerController.view.backgroundColor = [UIColor whiteColor];
        //阴影
        [_drawerController setShowsShadow:YES];
        //左边距离
        _drawerController.maximumLeftDrawerWidth = 200.0;
        _drawerController.maximumRightDrawerWidth = 200.0;
        //抽屉滑出方式
        [_drawerController setOpenDrawerGestureModeMask:MMOpenDrawerGestureModeAll];
        //抽屉滑入方式
        [_drawerController setCloseDrawerGestureModeMask:MMCloseDrawerGestureModeAll];
        
    }
    return _drawerController;
}

///主试图
-(ZMMainViewController *)mainViewController
{
    if (!_mainViewController) {
        _mainViewController = [[ZMMainViewController alloc] init];
        _mainViewController.selectedIndex = 0;
    }
    return _mainViewController;
}

///左视图
-(HZZPersonalCenterViewController *)leftViewController
{
    if (!_leftViewController) {
        _leftViewController = [[HZZPersonalCenterViewController alloc] init];
    }
    return _leftViewController;
}

@end

